import request from '@/utils/request'

export default {
  // 创建订单
  createOrder(courseId) {
    return request({
      url: `/order/createOrder/${courseId}`,
      method: 'put'
    })
  },
  // 获取订单信息
  selectOrderInfo(orderNo) {
    return request({
      url: `/order/selectOrderInfo/${orderNo}`,
      method: 'post'
    })
  },
  // 获取微信支付二维码
  generateCode(orderNo) {
    return request({
      url: `/payLog/generateCode/${orderNo}`,
      method: 'get'
    })
  },
  // 确认支付
  checkPayStatus(orderNo) {
    return request({
      url: `/payLog/checkPayStatus/${orderNo}`,
      method: 'post'
    })
  },
  // 查询课程支付情况
  queryCourseStatus(courseId) {
    return request({
      url: `/order/selectOrderStatus/${courseId}`,
      method: 'post'
    })
  }
}
